package etnorservice.etnor_service.service;

import com.baomidou.mybatisplus.extension.service.IService;
import etnorservice.etnor_service.domain.dto.ApiCountDTO;
import etnorservice.etnor_service.domain.dto.ApiLogDTO;
import etnorservice.etnor_service.domain.dto.ApiPublishConfigRequest;
import etnorservice.etnor_service.domain.dto.ParamsDTO;
import etnorservice.etnor_service.domain.po.*;
import etnorservice.etnor_service.domain.response.PolicyBaseResponse;
import etnorservice.etnor_service.domain.vo.*;
import etnorservice.etnor_service.request.*;
import org.apache.ibatis.annotations.Param;

import java.sql.SQLException;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author cc
 * @since 2024-06-30
 */
public interface IApiService  {
   List<ApiDTO> getAllApis();
   List<ApiDTO> getAllApi();
   List<ApiDTO> getApisByKewordsAndCatelog(String keyword,String catelog);
   List<ApiCategory> apiKinds();
   List<ApiSelectByTalentIdVO> getApisByTalentId(int talentId);
   int addApi(ApiRequest apiRequest);
   List<ApiReviewVO> findApiReviewList();
   List<ModeStatusNoteDTO> findModes();
   ModeStatusNoteDTO findCurrentMode();
   int changeMode(Integer modeid);
   int passApiReview(Long apiId);
   int rejectAndInsert(ApiRejectRequest apiRejectRequest);
   List<ApiAduit> getAduitList(Integer talentId);
   ApiDTO findApiByid(Integer id);
   PolicyBaseResponse findAllPolicy();
   int publishApi(PublishRequest request);
   ApiDetailsVO findApiById(String apiid);
   String findTestUrl(String apiid);
   void saveApiLog(ApiLog apiLog);
   List<ApiLog> findLogs(String apiid);
   void submitApi(ApiSubmission apiSubmission);
   public List<ApiManagementVO> findApiList(ApiSearchRequest request);
   ApiCountDTO getApiCounts();
   List<ApiDTO> getApisByAccount(String talentid);
   List<ParamsDTO> getParams(String apiid);
   //发布接口（新）
   void publishApi(ApiParamsRequest apiParamsRequest) throws SQLException;

   //新增接口（新）
   void insertApiNew(ApiSubmission apiSubmission);

   List<ApiCategory> findAllCatelogies();

   void approveApi(String apiid);

   void rejectApi(ApiReject apiReject) throws SQLException;

   ApiReject findReject(String apiid);

   void insertApiRequestLog(ApiRequestLog apiRequestLog) throws SQLException;

   ApiLogDTO findApiRequestLog(String apiid);

   Integer getApiCount(String apiid);


   //统计数据获取

    List<ApiStatisticsDTO> getApiStatistics();




    void addApiParams(List<ApiParams> apiParams);



   // 验证API所有权
   boolean validateApiOwnership(Long apiId, String account);

   // 保存发布配置
   void savePublishConfig(ApiPublishConfigRequest request) throws Exception;

   // 获取发布配置
   ApiPublishConfig getPublishConfig(Long apiId);

   // 下架API
   void offlineApi(Long apiId) throws Exception;

   void reAudit(Long apiId);



   ApiPublishConfig getApiConfig(Long apiId);


   Integer countApiCalls(Long apiId);


   void publishApi(String apiid);

   ApiToken findApiToken(Long apiid,Long userId );










}
